Skip to content

Conversation

@NoOne7135
Copy link
Contributor

No description provided.

@NoOne7135 NoOne7135 requested a review from ivictbor May 22, 2025 08:47
@ivictbor ivictbor requested a review from Copilot May 22, 2025 09:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the new filtersTools functionality to manage query filters via hooks. It introduces a new hook in apartments.ts, integrates filtersTools in the REST API module, adds the filtersTools module, and updates documentation accordingly.

  • Added AdminForthResource import and a new beforeDatasourceRequest hook in apartments.ts.
  • Integrated filtersTools into resource and dropdown hooks in restApi.ts.
  • Introduced the filtersTools module with utility methods for query filters.
  • Updated documentation (04-hooks.md) to demonstrate the usage of filtersTools.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dev-demo/resources/apartments.ts Adds a new beforeDatasourceRequest hook and a realtor_id column configuration using filtersTools.
adminforth/modules/restApi.ts Integrates filtersTools into hook calls for datasource requests.
adminforth/modules/filtersTools.ts Introduces a new module providing utilities for filter operations.
adminforth/documentation/docs/tutorial/03-Customization/04-hooks.md Updates the code example for applying a realtor_id filter to use filtersTools.
Comments suppressed due to low confidence (1)

adminforth/documentation/docs/tutorial/03-Customization/04-hooks.md:140

  • The code example is missing a closing parenthesis and uses 'filterTools' instead of 'filtersTools' as defined in the implementation. Please update the example to: query.filtersTools.replaceOrAddTopFilter(Filters.EQ('realtor_id', adminUser.dbUser.id)).
query.filterTools.replaceOrAddTopFilter(Filters.EQ('realtor_id', adminUser.dbUser.id).

},

removeTopFilterIfExists(field: string) {
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoOne7135 lets get rid of try except

@ivictbor ivictbor merged commit 4de0654 into next May 23, 2025
1 check passed
@NoOne7135 NoOne7135 deleted the simplify-ui-for-working-with-filters branch October 29, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants